-
Notifications
You must be signed in to change notification settings - Fork 7
Install codeql in s-core-devcontainer #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
resolves #69 |
lurtz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good so far
src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
| VARIANT=linux64 | ||
| SHA256SUM="${codeql_amd64_sha256}" | ||
| elif [ "${ARCHITECTURE}" = "arm64" ]; then | ||
| VARIANT=osx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variant string is incorrect. But we should also investigate, if the osx variant runs on ubuntu arm64 at all...
| VARIANT=osx | |
| VARIANT=osx64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codeql does not support ubuntu on arm64, just native macs. Although codeql engine is written in JAVA, the language specific extractors are native applications. Therefore codeql cannot be used on ubuntu arm64:
./cpp/tools/osx64/cpp-telemetry: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 64-bi...
./cpp/tools/osx64/extractor: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 64-bit x8...
./cpp/tools/osx64/trap-cache-reader: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 6...
./cpp/tools/osx64/hash: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 64-bit x...I will remove codeql for arm64 architectures and install it only for amd64.
clemens-k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ready to be merged
Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml
Outdated
Show resolved
Hide resolved
|
pay also attention to #76 (comment) |
okay Co-authored-by: lurtz <727209+lurtz@users.noreply.github.com> Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
move codeql test to s-core-local tests Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
fixed incorrect path Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
clemens-k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests were successful:
- building the new devcontainer for amd64
- test scripts showed no error
codeqlis in PATHcodeql packs resolveshowed codeql found the general, MISRA and CERT related rules- first experiment was successful: checking nlohmann/json against MISRA C++ rules
|
@clemens-k I'm afraid in the meantime |
|
@lurtz @opajonk according to @clemens-k this adds 1.7 GB to the image. Is that acceptable? |
size impact to be consideered
|
I can probably slim down the installation a bit (removing java, go, csharp, ruby and javascript extractors, example code and rules). This will reduce the size impact to 926 MB. If we want to reduce more, we would need to drop Rust support (~100 MB) or CERT coding standards (~100 MB)... |
It is a lot. This also opens the door of what has to be in the image and what not. E.g. a Rust and LLVM / clang toolchain is included as well, despite that presumably bazel downloads the toolchains. We did this because we either struggled to get code completion running otherwise, bazel was still using files from the host and we just have the opinion that we prefer toolchains provided by the devcontainer instead of bazel. When we want to introduce the devcontainer in more CI builds, it is better to keep a small size and depending on the amount of tooling for CI or developers needed we could split it into two images: a small one used in CI with only essential tools needed for CI included and a bigger one, which builds on top of the small one with developer tools added. However this only makes sense if codeql is either only used by developers or in very few jobs. |
|
This is the disk space usage added, by each layer of the container image:
Total image size is 4.3 GB. IMHO we should have a smaller image for CI. FYI the image was inspected with https://github.com/wagoodman/dive |
FScholPer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the Readme?!
Do we still want to use llvm |
|
@lurtz I didn't know The intention of adding codeql was to enable SCA checks (MISRA C++ and CERT C++) in our code. The pipeline should run a SCA checks to make sure developers don't introduce new SCA warnings with a PR (or to at least make it visible). For this pipeline usecase github already offers a github action. I found several PRs related to that, but they were not successful yet and the github action does not solve the issue of all developers to see those SCA warnings as early as possible (ideally while typing code while using the score devcontainer): So the primary purpose of installing codeql and preloading the coding rules is that developers can easily run SCA checks. As long as the github action doesn't produce usable results, we could also use this "local installation" as fallback for the pipeline. Which means we would also need to include codeql in the "slim" CI image. |
What exactly is missing or outdated? |
|
@FScholPer @lurtz The action for amd64 was now successful, so the PR could be merged. There are 2 open topics:
|
|
Codeql documentation (howto) is missing |
I will look into the size issues on main |


other changes: